﻿#ifndef MAGNIFYTIMERWIDGET_H
#define MAGNIFYTIMERWIDGET_H

#include <QDialog>
#include <QHBoxLayout>
#include <QLabel>

class MagnifyTimerWidget : public QDialog
{
    Q_OBJECT
public:
    enum STATES {
        COUNTDOWN = 0,
        THETIMER
    };

    explicit MagnifyTimerWidget(QWidget *parent = nullptr);
    ~MagnifyTimerWidget();

    void SetState(MagnifyTimerWidget::STATES state);

private:


    void InitUi( void );
    void InitProperty( void );

protected:
    void showEvent(QShowEvent *event);
    void mousePressEvent(QMouseEvent *event);

signals:
    void closeed();

public slots:
    void updatetimer(int timer);

private:
    MagnifyTimerWidget::STATES m_yState;

    QHBoxLayout *m_pRootLayout;

    QWidget *m_pRootWidget;
    QHBoxLayout *m_pRootWidgetLayout;

    QWidget *m_pTimeWidget;
    QHBoxLayout *m_pTimeWidgetLayout;
    QLabel *m_pTimeLabel;
    QLabel *m_pColon_0;
    QLabel *m_pMinuteLabel;
    QLabel *m_pColon_1;
    QLabel *m_pSecondLabel;

    int m_iSumTime;
    int m_iTime;
    int m_iMinute;
    int m_iSecond;

};

#endif // MAGNIFYTIMERWIDGET_H
